package com.lagou.client;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

public class ClientInit {
    private ObjectOutputStream oos;
    private ObjectInputStream ois;
    private Socket s;

    public ObjectOutputStream getOos() {
        return oos;
    }

    public void setOos(ObjectOutputStream oos) {
        this.oos = oos;
    }

    public ObjectInputStream getOis() {
        return ois;
    }

    public void setOis(ObjectInputStream ois) {
        this.ois = ois;
    }

    public void clientInit() throws IOException {
        s = new Socket(InetAddress.getLocalHost(), 8888);
        oos = new ObjectOutputStream(s.getOutputStream());
        ois = new ObjectInputStream(s.getInputStream());
        System.out.println("连接服务器成功");



    }
    public void clientClose() throws IOException {
        oos.close();
        ois.close();
        s.close();
        System.out.println("客户端成功关闭");

    }
}
